package com.ruoyi.framework.config;

import com.aliyun.oss.OSSClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
public class ALiOSSConfig {
    @Value("${oss.alyun.endpoint}")
    private String endpoint;

    @Value("${oss.alyun.accessKeyId}")
    private String accessKeyId;

    @Value("${oss.alyun.accessKeySecret}")
    private String accessKeySecret;

    @Value("${oss.alyun.bucketName}")
    private String bucketName;


    @Bean
    public OSSClient ossClient() {

        return new OSSClient(endpoint, accessKeyId, accessKeySecret);
    }
}
